<!DOCTYPE html>
<html lang="en">

<head>
	<meta charset="UTF-8">
	<meta http-equiv="X-UA-Compatible" content="IE=edge">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Document</title>
</head>

<body>
	<script>
		function Foo() {
			getName = function () { console.log(1) }
			return this

		}

		Foo.getName = function () { console.log(2) }

		Foo.prototype.getName = function () { console.log(3) }

		var getName = function () { console.log(4) }

		function getName() { console.log(5) }

		//以下输出的结果是？
		Foo.getName()//输出2
		getName()//输出4
		Foo().getName();//输出1
		getName();//输出1
		new Foo.getName()//输出2
		new Foo().getName()//输出3



		new new Foo().getName()//输出3
		let obj = new Foo();
		new obj.getName()
		new function () { console.log(3) }
	</script>
</body>

</html>